package com.itheima.dao;

import com.itheima.domain.Collection2;
import com.itheima.domain.FilePojo;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CollectionDao {
    @Insert("insert into collection  values(null,#{qid}, #{uid})")
    public int save(Collection2 collection);

    @Delete("delete from collection where  qid = #{qid} and uid =#{uid}")
    public int delete(Collection2 collection);

    @Select("select * from collection where qid = #{qid} and uid = #{uid} ")
    public Collection2 getById(@Param("qid")Integer qid, @Param("uid")Integer uid);

    @Select("select * from collection")
    public List<Collection2> getAll();

    @Select("select * from collection where uid = #{uid} ")
    public List<Collection2> getByUid(Integer uid);
}
